<template>
  <div id="app">
    <headerviewblack>
    </headerviewblack>
    <!-- <headerview>
    </headerview> -->
    <router-view />
    <footerviewblack>
    </footerviewblack>
    <!-- <footerview>
    </footerview> -->
    <contact />
  </div>
</template>

<script>
  import headerview from "@/components/common/headerview";
  import headerviewblack from "@/components/common/headerviewblack"
  import footerview from "@/components/common/footerview";
  import footerviewblack from "@/components/common/footerviewblack"
  import contact from "@/components/common/contact"
  export default {
    components: {
      headerview,
      headerviewblack,
      footerview,
      footerviewblack,
      contact
    },
    data() {
      //这里存放数据
      return {};
    },
    //监听属性 类似于data概念
    computed: {},
    //监控data中的数据变化
    watch: {},
    //方法集合
    methods: {
      _isMobile() {
        let flag =
          navigator.userAgent.match(
            /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone) /i
          )
        return flag;
      },
      newPathfn() {
        console.log(this.newPath);
        console.log(this.$route.path);
        console.log(this.newPath.includes(!this.$route.path));
        let that = this;
        this.newPath.includes(toString(that.$route.path))
      }
    },
    //生命周期 - 创建完成（可以访问当前this实例）
    created() {
      document.body.removeChild(document.getElementById('Loading'));
      let url = document.URL;
      // if(url.indexOf('lmdbw')>-1){
      //   localStorage.setItem('beianhao','豫ICP备2021009203号-3');
      // }else if(url.indexOf('lumayun')>-1){
      //   localStorage.setItem('beianhao','豫ICP备2021009203号-2');
      // }else if(url.indexOf('lmdbw')>-1){
      //   localStorage.setItem('beianhao','豫ICP备2021009203号-1');
      // }else if(url.indexOf('lumawb')>-1){
      //   localStorage.setItem('beianhao','豫ICP备2021009203号-4');
      // }else{
      //   localStorage.setItem('beianhao','豫ICP备2021009203号');
      // }

      if (url.indexOf('lmdbw') > -1) {
        localStorage.setItem('beianhao', '豫ICP备2021009203号');
      } else if (url.indexOf('lumayun') > -1) {
        localStorage.setItem('beianhao', '豫ICP备2021009203号');
      } else if (url.indexOf('lmdbw') > -1) {
        localStorage.setItem('beianhao', '豫ICP备2021009203号');
      } else if (url.indexOf('lumawb') > -1) {
        localStorage.setItem('beianhao', '豫ICP备2021009203号');
      } else {
        localStorage.setItem('beianhao', '豫ICP备2021009203号');
      }
    },
    //生命周期 - 挂载完成（可以访问DOM元素）
    mounted() {
      console.log(this.$route.path)
      if (this._isMobile()) {
        alert("请从电脑端访问本站，或微信小程序搜索撸码云");
      } else {
        // alert("pc端");
      }
    },
  }

</script>

<style>
  #app {
    font-family: PingFangSC-Regular, PingFang SC;
  }

  body {
    background-color: #f7fafe
  }

  /* 加载中全局背景 */
  .loading-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: #F7FAFE;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
  }

  .login-wrapper {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
  }

  .login-wrapper img {
    position: absolute;
    z-index: 1;
  }

  a {
    text-decoration: none;
  }

</style>
